package bean;

import java.math.BigDecimal;
import java.util.Objects;

public class ProductCartItem {
    private Integer productId;
    private Integer count;
    private BigDecimal price;
    private String name;

    public ProductCartItem() {
    }

    @Override
    public String toString() {
        return "ProductCartItem{" +
                "productId=" + productId +
                ", count=" + count +
                ", price=" + price +
                ", name='" + name + '\'' +
                '}';
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ProductCartItem(Integer productId, Integer count, BigDecimal price, String name) {
        this.productId = productId;
        this.count = count;
        this.price = price;
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ProductCartItem)) return false;
        ProductCartItem that = (ProductCartItem) o;
        return Objects.equals(productId, that.productId);
    }


}
